jQuery(document)
		.ready(
				function() {
					if (jQuery("#goTopBox").length < 1) {
						jQuery("body")
								.append(
										'<div class="box-wrapper"><div class="qrcode"><p>微信扫一扫</p><img src="'
												+ get_config("SYS_PATH")
												+ '/img/weixin_qrcode.jpg" alt="微信扫一扫关注腾讯大讲堂"></div><div id="goTopBox" style="display: none;">顶部</div><div class="support-box">反馈</div></div>')
					}
					var a = "";
					a += '<div id="dialog-support-success"><div class="icon-success"></div><div class="content"><span id="dialog-support-success-content">感谢您的反馈</span></div></div>';
					jQuery("body").append(a);
					a = '<div id="dialog-support" style="overflow: hidden;">';
					a += '<div class="titled-block">';
					a += '<div class="form-wrapper clearfix">';
					a += "<p>请帮助我们改进，我们在倾听</p>";
					a += '<textarea rows="5" id="support-text"></textarea>';
					a += "</div></div></div>";
					jQuery("body").append(a);
					jQuery(window).scroll(function() {
						if (jQuery(this).scrollTop() > 200) {
							jQuery("#goTopBox").fadeIn(200)
						} else {
							jQuery("#goTopBox").fadeOut(200)
						}
					});
					jQuery("#goTopBox").click(function() {
						jQuery(window).scrollTop(0);
						return false
					});
					jQuery("#dialog-support")
							.dialog(
									{
										title : "反馈建议",
										autoOpen : false,
										modal : true,
										closeOnEscape : true,
										draggable : true,
										resizable : false,
										width : 400,
										dialogClass : "share-dialog",
										buttons : {
											"提交" : function() {
												var e = jQuery.trim(jQuery(
														"#support-text").val()), c = get_config("USER"), d = c != null
														&& typeof c.token != "undefined" ? c.token
														: "", b = e.length;
												if (b == 0) {
													alert("请输入反馈意见，谢谢");
													return
												} else {
													if (!/[\u4e00-\u9fa5]/
															.test(e)) {
														alert("至少包含一个汉字，谢谢");
														return
													} else {
														if (b < 5) {
															alert("反馈意见过短，谢谢");
															return
														} else {
															if (b > 500) {
																alert("反馈意见不要大于500字，谢谢");
																return
															} else {
																jQuery
																		.ajax({
																			type : "post",
																			url : get_config("SYS_PATH")
																					+ "/suggest/submit_suggestion",
																			dataType : "xml",
																			data : {
																				text : e,
																				token : d
																			},
																			success : function(
																					f) {
																				if (jQuery(
																						f)
																						.find(
																								"ret")
																						.text() != 0) {
																					jQuery(
																							"#dialog-support-success-content")
																							.text(
																									"系统忙，请稍后重试")
																				}
																				jQuery(
																						"#dialog-support-success")
																						.dialog(
																								"open");
																				setTimeout(
																						"jQuery('#dialog-support-success').dialog('close');",
																						1500);
																				jQuery(
																						"#support-text")
																						.val(
																								"")
																			}
																		});
																jQuery(this)
																		.dialog(
																				"close")
															}
														}
													}
												}
											},
											"取消" : function() {
												jQuery(this).dialog("close")
											}
										},
										open : function(b, c) {
											jQuery(".ui-widget-overlay").css(
													"background", "#333").css(
													"opacity", "0.5");
											jQuery(".ui-dialog-buttonpane")
													.find("button").eq(0)
													.children("span").addClass(
															"button-focus")
										}
									});
					jQuery("#dialog-support-success").dialog(
							{
								autoOpen : false,
								closeOnEscape : true,
								modal : true,
								resizable : false,
								draggable : false,
								width : 170,
								height : 60,
								dialogClass : "share-success-dialog",
								open : function(b, c) {
									jQuery(".ui-widget-overlay").css(
											"background", "#333").css(
											"opacity", "0.5")
								}
							});
					jQuery(".support-box").click(function() {
						jQuery("#dialog-support").dialog("open")
					})
				});